<?php

Route::group(['middleware' => 'web', 'prefix' => 'admin', 'namespace' => 'Modules\Admin\Http\Controllers'], function()
{
	Auth::routes();
});
Route::group(['middleware' => ['web','auth:admin'], 'prefix' => 'admin', 'namespace' => 'Modules\Admin\Http\Controllers'], function()
{
	Route::get('/', 'AdminController@index');
	Route::resource('/adminuser','AdminUserController')->middleware("permission:admin,resource");
	Route::resource('/role','RoleController')->middleware("permission:admin,resource");
	Route::get('/showPermission/{roleid}','RoleController@showPermission')->name('showPermission')->middleware("permission:admin");
	Route::post('/addPermission/{roleid}','RoleController@addPermission')->name('addPermission')->middleware("permission:admin");
	Route::get('/showRole/{adminid}','AdminUserController@showRole')->name('showRole')->middleware("permission:admin");
	Route::post('/addRole/{adminid}','AdminUserController@addRole')->name('addRole')->middleware("permission:admin");
});

 
//module-route
Route::group(['middleware' => ['web', 'auth:admin'],'prefix'=>'admin','namespace'=>"Modules\Admin\Http\Controllers"], 
function () {
    Route::get('/module','ModuleController@index');
    Route::get('/updateModule','ModuleController@updateModule');
    Route::get('/setdefault/{module}','ModuleController@setdefault')->name('setdefault');
    Route::get('/template','TemplateController@index');
    Route::get('/template/{id}','TemplateController@setDefault');
});